export const request = function(options) {
	// const baseApi = 'http://localhost:3000/api'
	const baseApi = 'https://www.guniao.top:3000/api'
	const {
		url,
		method,
		data
	} = options

	return new Promise((resolve, reject) => {
		uni.request({
			url: baseApi + url,
			method,
			data,
			success: function(res) {
				resolve(res.data)
			},
			fail: function(error) {
				uni.showToast({
					title: error.errMsg,
					duration: 2000
				})
				reject(error)
			}
		});
	})

}
